import { connect } from 'dva';
import React from 'react'

//权限鉴定
const Authentication = (WrappedComponent, privilege, loginModel) => {
  // console.log(loginModel, privilege)
  if (Object.keys(loginModel).length > 0) {
    if (loginModel.privilege_list.indexOf(privilege) > -1) {
      return <WrappedComponent  />;
      // return <WrappedComponent {...this.props} />;
     
    } else {
      return '';
    }
  } else {
    return '';
  }
}


export default Authentication

